package org.dreamwork.tools;

import java.util.logging.ConsoleHandler;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.logging.SimpleFormatter;

/**
 * Created by seth.yang on 2018/12/11
 */
public class LogFactory {
    public static Logger getLogger (Class<?> type) {
        Logger logger = Logger.getLogger (type.getName ());
        ConsoleHandler handler = new ConsoleHandler ();
        handler.setFormatter (new SimpleFormatter ());
        handler.setLevel (Level.ALL);
        logger.addHandler (handler);
        logger.setLevel (Level.ALL);
        return logger;
    }
}
